package org.jeecg.modules.rental.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @Description: 代金券核销
 * @Author: sean
 * @Date:   2024-08-19
 * @Version: V1.0
 */
@Data
@TableName("rental_coupon_writeoff")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="rental_coupon_writeoff对象", description="卡券核销")
public class RentalCouponWriteoff implements Serializable {
    private static final long serialVersionUID = 1L;

	/**代金券核销id*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "代金券核销id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
	/**代金券id*/
	@Excel(name = "代金券id", width = 15)
    @ApiModelProperty(value = "代金券id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long accountCouponId;

    @TableField(exist = false)
    private String couponCode;

    @Excel(name = "代金券配置名称", width = 15)
    @ApiModelProperty(value = "代金券配置名称")
    @TableField(exist = false)
    private String configName;
    /**使用门槛金额 0-无门槛*/
    @Excel(name = "使用门槛金额", width = 15)
    @ApiModelProperty(value = "使用门槛金额")
    @TableField(exist = false)
    private BigDecimal minAmount;
    /**满减金额*/
    @Excel(name = "面值(抵扣券需要)", width = 15)
    @ApiModelProperty(value = "面值(抵扣券需要)")
    @TableField(exist = false)
    private BigDecimal faceValue;

	/**关联订单id*/
	@Excel(name = "关联订单id", width = 15)
    @ApiModelProperty(value = "关联订单id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long orderId;
    /**抵扣金额，抵扣的金额可能小于面值*/
    @Excel(name = "抵扣金额", width = 15)
    @ApiModelProperty(value = "抵扣金额")
    private BigDecimal discAmount;
    /**使用门店id*/
    @Excel(name = "使用门店id", width = 15)
    @ApiModelProperty(value = "使用门店id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long storeId;

    @TableField(exist = false)
    private String storeName;

	/**使用时间*/
	@Excel(name = "使用时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "使用时间")
    private LocalDateTime useTime;
	/**所属部门*/
    @ApiModelProperty(value = "所属部门")
    private String sysOrgCode;
	/**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
	/**创建日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private LocalDateTime createTime;
	/**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
	/**更新日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private LocalDateTime updateTime;
    @Excel(name = "核销记录状态", width = 15)
    @ApiModelProperty(value = "核销记录状态 0 生效  1 已失效")
    @JsonSerialize(using = ToStringSerializer.class)
    private String status;
	/**是否删除（0：否、1：是）*/
	@Excel(name = "是否删除（0：否、1：是）", width = 15)
    @ApiModelProperty(value = "是否删除（0：否、1：是）")
    @TableLogic(value="0", delval = "1")
    private String isDelete;
}
